<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Multicore Manager (MCMGR) User&#39;s Guide: MCMGR Component</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="nxp_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Multicore Manager (MCMGR) User&#39;s Guide
   &#160;<span id="projectnumber">Rev. 3.0.0</span>
   </div>
   <div id="projectbrief">NXP Semiconductors</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li class="current"><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>API&#160;Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('index.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">MCMGR Component </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>The Multicore Manager (MCMGR) software library provides a number of services for multicore systems. This library is distributed as a part of the Multicore SDK (MCSDK). Together, the MCSDK and the MCUXpresso SDK (SDK) form a framework for development of software for NXP multicore devices.</p>
<p>The MCMGR component default location is located in the &lt;MCUXpressoSDK_install_dir&gt;/middleware/multicore_&lt;version&gt;/mcmgr directory.</p>
<div class="image">
<img src="mcsdk.png" alt="mcsdk.png"/>
</div>
<p>The Multicore Manager provides the following major functions:</p>
<ul>
<li>Maintains information about all cores in system.</li>
<li>Secondary/auxiliary core(s) startup and shutdown.</li>
<li>Remote core monitoring and event handling.</li>
</ul>
<h1><a class="anchor" id="usage"></a>
Usage of the MCMGR software component</h1>
<p>The main use case of MCMGR is the secondary/auxiliary core start. This functionality is performed by the public API function.</p>
<p>Example of MCMGR usage to start secondary core:</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;mcmgr.h&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">void</span> main()</div><div class="line">{</div><div class="line">    <span class="comment">/* Initialize MCMGR - low level multicore management library.</span></div><div class="line"><span class="comment">       Call this function as close to the reset entry as possible,</span></div><div class="line"><span class="comment">       (into the startup sequence) to allow CoreUp event triggering. */</span></div><div class="line">    <a class="code" href="group__mcmgr.html#ga113834314ba8d727f8d601463ee71e88">MCMGR_EarlyInit</a>();</div><div class="line"></div><div class="line">    <span class="comment">/* Initialize MCMGR, install generic event handlers */</span></div><div class="line">    <a class="code" href="group__mcmgr.html#gab18e570ea8c466214b3725785d45aa35">MCMGR_Init</a>();</div><div class="line"></div><div class="line">    <span class="comment">/* Boot secondary core application from the CORE1_BOOT_ADDRESS, pass &quot;1&quot; as startup data, starting synchronously. */</span></div><div class="line">    <a class="code" href="group__mcmgr.html#gac7850a1875bec8499300b1915a79a596">MCMGR_StartCore</a>(<a class="code" href="group__mcmgr.html#gga04ccbddec3c91482490e57e53afbeb6fae5ff151633b4ee4b9dc9e0825675ecc1">kMCMGR_Core1</a>, CORE1_BOOT_ADDRESS, 1, <a class="code" href="group__mcmgr.html#gga2b471b0504b78138baba1e17a05a9b9ca1d97daf76353ad10e9ccdf91c42c759f">kMCMGR_Start_Synchronous</a>);</div><div class="line">.</div><div class="line">.</div><div class="line">.</div><div class="line">    <span class="comment">/* Stop secondary core execution. */</span></div><div class="line">    <a class="code" href="group__mcmgr.html#gab11c27fda1a646433b0d8cef19de6ee4">MCMGR_StopCore</a>(<a class="code" href="group__mcmgr.html#gga04ccbddec3c91482490e57e53afbeb6fae5ff151633b4ee4b9dc9e0825675ecc1">kMCMGR_Core1</a>);</div><div class="line">}</div></div><!-- fragment --><p>Another important MCMGR feature is the ability for remote core monitoring and handling of events such as reset, exception, and application events. Application-specific callback functions for events are registered by the <a class="el" href="group__mcmgr.html#ga08a4a13691e04c934998926adb277ae2" title="Register event handler. ">MCMGR_RegisterEvent()</a> API. Triggering these events is done using the <a class="el" href="group__mcmgr.html#ga75116754c189363da844f4a1a6da0f47" title="Trigger event handler. ">MCMGR_TriggerEvent()</a> API. mcmgr_event_type_t enums all possible event types.</p>
<p>An example of MCMGR usage for remote core monitoring and event handling. Code for the primary side:</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;mcmgr.h&quot;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#define APP_RPMSG_READY_EVENT_DATA  (1)</span></div><div class="line"></div><div class="line">uint16_t RPMsgRemoteReadyEventData = 0;</div><div class="line"></div><div class="line"><span class="comment">/* Callback function registered via the MCMGR_RegisterEvent() and triggered by MCMGR_TriggerEvent() called on the secondary core side */</span></div><div class="line"><span class="keywordtype">void</span> RPMsgRemoteReadyEventHandler(uint16_t eventData, <span class="keywordtype">void</span> *context)</div><div class="line">{</div><div class="line">    RPMsgRemoteReadyEventData = eventData;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">void</span> main()</div><div class="line">{</div><div class="line">    <span class="comment">/* Initialize MCMGR - low level multicore management library.</span></div><div class="line"><span class="comment">       Call this function as close to the reset entry as possible,</span></div><div class="line"><span class="comment">       (into the startup sequence) to allow CoreUp event triggering. */</span></div><div class="line">    <a class="code" href="group__mcmgr.html#ga113834314ba8d727f8d601463ee71e88">MCMGR_EarlyInit</a>();</div><div class="line"></div><div class="line">    <span class="comment">/* Initialize MCMGR, install generic event handlers */</span></div><div class="line">    <a class="code" href="group__mcmgr.html#gab18e570ea8c466214b3725785d45aa35">MCMGR_Init</a>();</div><div class="line"></div><div class="line">    <span class="comment">/* Register the application event before starting the secondary core */</span></div><div class="line">    <a class="code" href="group__mcmgr.html#ga08a4a13691e04c934998926adb277ae2">MCMGR_RegisterEvent</a>(kMCMGR_RemoteApplicationEvent, RPMsgRemoteReadyEventHandler, NULL);</div><div class="line"></div><div class="line">    <span class="comment">/* Boot secondary core application from the CORE1_BOOT_ADDRESS, pass rpmsg_lite_base address as startup data, starting synchronously. */</span></div><div class="line">    <a class="code" href="group__mcmgr.html#gac7850a1875bec8499300b1915a79a596">MCMGR_StartCore</a>(<a class="code" href="group__mcmgr.html#gga04ccbddec3c91482490e57e53afbeb6fae5ff151633b4ee4b9dc9e0825675ecc1">kMCMGR_Core1</a>, CORE1_BOOT_ADDRESS, (uint32_t)rpmsg_lite_base, <a class="code" href="group__mcmgr.html#gga2b471b0504b78138baba1e17a05a9b9ca1d97daf76353ad10e9ccdf91c42c759f">kMCMGR_Start_Synchronous</a>);</div><div class="line"></div><div class="line">    <span class="comment">/* Wait until the secondary core application signals the rpmsg remote has been initialized and is ready to communicate. */</span></div><div class="line">    <span class="keywordflow">while</span>(APP_RPMSG_READY_EVENT_DATA != RPMsgRemoteReadyEventData) {};</div><div class="line">.</div><div class="line">.</div><div class="line">.</div><div class="line">}</div></div><!-- fragment --><p>Code for the secondary side:</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;mcmgr.h&quot;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#define APP_RPMSG_READY_EVENT_DATA  (1)</span></div><div class="line"></div><div class="line"><span class="keywordtype">void</span> main()</div><div class="line">{</div><div class="line">    <span class="comment">/* Initialize MCMGR - low level multicore management library.</span></div><div class="line"><span class="comment">       Call this function as close to the reset entry as possible,</span></div><div class="line"><span class="comment">       (into the startup sequence) to allow CoreUp event triggering. */</span></div><div class="line">    <a class="code" href="group__mcmgr.html#ga113834314ba8d727f8d601463ee71e88">MCMGR_EarlyInit</a>();</div><div class="line"></div><div class="line">    <span class="comment">/* Initialize MCMGR, install generic event handlers */</span></div><div class="line">    <a class="code" href="group__mcmgr.html#gab18e570ea8c466214b3725785d45aa35">MCMGR_Init</a>();</div><div class="line">.</div><div class="line">.</div><div class="line">.</div><div class="line"></div><div class="line">    <span class="comment">/* Signal the to other core that we are ready by triggering the event and passing the APP_RPMSG_READY_EVENT_DATA */</span></div><div class="line">    <a class="code" href="group__mcmgr.html#ga75116754c189363da844f4a1a6da0f47">MCMGR_TriggerEvent</a>(kMCMGR_RemoteApplicationEvent, APP_RPMSG_READY_EVENT_DATA);</div><div class="line">.</div><div class="line">.</div><div class="line">.</div><div class="line">}</div></div><!-- fragment --><h1><a class="anchor" id="revision_history"></a>
Revision History</h1>
<p>This table summarizes revisions of this document.</p>
<table class="doxtable">
<tr>
<th>Revision number</th><th>Date </th><th>Substantive changes  </th></tr>
<tr>
<td>1.0 </td><td>09/2016 </td><td>Initial release </td></tr>
<tr>
<td>2.0.1 </td><td>02/2017 </td><td>Minor updates for the SDK Rel6 </td></tr>
<tr>
<td>3.0.0 </td><td>08/2017 </td><td><p class="starttd">API changes: </p>
<p>- Removed MCMGR_LoadApp(), MCMGR_MapAddress() and MCMGR_SignalReady() </p>
<p>- Modified <a class="el" href="group__mcmgr.html#ga36fd13120448560dbbfe405eaa8d482a" title="Get startup data for the slave core. ">MCMGR_GetStartupData()</a> </p>
<p>- Added <a class="el" href="group__mcmgr.html#ga113834314ba8d727f8d601463ee71e88" title="Initialize the multicore manager, early init. ">MCMGR_EarlyInit()</a>, <a class="el" href="group__mcmgr.html#ga08a4a13691e04c934998926adb277ae2" title="Register event handler. ">MCMGR_RegisterEvent()</a> and <a class="el" href="group__mcmgr.html#ga75116754c189363da844f4a1a6da0f47" title="Trigger event handler. ">MCMGR_TriggerEvent()</a> </p>
<p></p>
<p class="endtd">Added the ability for remote core monitoring and event handling </p>
</td></tr>
</table>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.5-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul class="foot">
    <li class="footer">&copy; 2016 NXP Semiconductors. All rights reserved.
    </li>
  </ul>
</div>
</body>
</html>
